import instance from "./request";

import qs from "qs"

// 精品推荐接口
let JingpinAPI = () => instance.get("/products/recommend");

// 热门推荐接口
let RenmenAPI = () => instance.get("/products/hot",);

// 更多接口
let AllGift = (params) => instance.get("/products", { params });
// 发送短信验证码接口
let sendSMSAPI = (params) => instance.post("/sendSMS", qs.stringify(params));
// 手机号码登录接口
let PhoneReginAPI = (params) => instance.post("/phoneRegin", qs.stringify(params));

// 微信扫码登录
let weixinLoginAPI = (params) => instance.post("/wechatUsers/PCLogin", qs.stringify(params));

// 手机号绑定微信
let BindingAPI = (params) => instance.post("/wechatUsers/binding", qs.stringify(params));

// 获取用户信息
let UserProfilesAPI = () => instance.get("/shop/userProfiles");

// /products/{id}
// 商品详情页
let GoodDetailsAPI = (id) => instance.get(`/products/${id}`);

// 
// 添加购物车
let addToCartAPI = (params) => instance.post("/shop/carts/add", qs.stringify(params));



export { JingpinAPI, RenmenAPI, AllGift, sendSMSAPI, PhoneReginAPI, weixinLoginAPI, BindingAPI, UserProfilesAPI, GoodDetailsAPI, addToCartAPI };